@import '../core/theming/palette';
@import '../core/theming/theming';
@import '../core/theming/private';

@mixin mat-progress-spinner-color($config-or-theme) {
  $config: mat-get-color-config($config-or-theme);
  $primary: map-get($config, primary);
  $accent: map-get($config, accent);
  $warn: map-get($config, warn);

  .mat-progress-spinner, .mat-spinner {
    circle {
      stroke: mat-color($primary);
    }

    &.mat-accent circle {
      stroke: mat-color($accent);
    }

    &.mat-warn circle {
      stroke: mat-color($warn);
    }
  }
}

@mixin mat-progress-spinner-typography($config-or-theme) {}

@mixin _mat-progress-spinner-density($config-or-theme) {}

@mixin mat-progress-spinner-theme($theme-or-color-config) {
  $theme: mat-private-legacy-get-theme($theme-or-color-config);
  @include mat-private-check-duplicate-theme-styles($theme, 'mat-progress-spinner') {
    $color: mat-get-color-config($theme);
    $density: mat-get-density-config($theme);
    $typography: mat-get-typography-config($theme);

    @if $color != null {
      @include mat-progress-spinner-color($color);
    }
    @if $density != null {
      @include _mat-progress-spinner-density($density);
    }
    @if $typography != null {
      @include mat-progress-spinner-typography($typography);
    }
  }
}
